/*
 *	The temperature program prints table for fahrenheit-celsius and 
 *	celsius-fahrenheit in reverse; from 300 to 0 and from 150 to -50.
 *	Copyright (C) 1989-2089 Sergey Sergeevich Tsybanov All Rights Reserved
 *
 *	Temperature is free software: you can redistribute it and/or modify 
 *	it under the terms of the GNU General Public License as published 
 *	by the Free Software Foundation, either version 3 of the License, 
 *	or (at your option) any later version.
 *
 *	Temperature is distributed in the hope that it will be useful, but 
 *	WITHOUT ANY WARRANTY; without even the implied warranty of 
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 *	See the GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License 
 *	along with the temperature program. 
 *	If not, see <https://www.gnu.org/licenses/>.
 */

#include <stdio.h>

/*
 *	Print table for fahrenheit-celsius and celsius-fahrenheit in reverse;
 *	from 300 to 0 and from 150 to -50.
 */
int main( void)
{
	printf( "%s\n%s\n%s\n%s\n%s\n",
		"=====================",
		"= Temperature Conv. =",
                "=====================",
                "== Fo  =======  Co ==",
		"=====================");
	double celsius;
	for ( celsius = 150; celsius >= -50; celsius -= 10) {
		printf( "%6.0f\t%10.3f\n", celsius,
			9.0 / 5 * celsius + 32);
	}

	printf( "%s\n%s\n%s\n%s\n%s\n",
		"=====================",
		"= Temperature Conv. =",
		"=====================",
		"== Co  =======  Fo ==",
		"=====================");
	double fahrenheit;
	for ( fahrenheit = 300; fahrenheit >= 0; fahrenheit -= 15) {
		printf( "%6.0f\t%10.3f\n", fahrenheit,
			5.0 / 9 * ( fahrenheit - 32));
	}

	return 0;
}